package com.swufe.myapplication;

import android.content.Context;
import android.content.SharedPreferences;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;

/*2022/5/28*/
public class TopScore {
    private SharedPreferences sp;

    public TopScore(Context context) {
        sp = context.getSharedPreferences("TopScore", context.MODE_PRIVATE);
    }

    public int getTopScore() {
        int TopScore = sp.getInt("TopScore", 0);
        return TopScore;
    }

    public void setTopScore(int TopScore) {
        SharedPreferences.Editor editor = sp.edit();
        editor.putInt("TopScore", TopScore);
        editor.commit();
    }
}
